#include "EmoGui.h"

BEGIN_EVENT_TABLE( EmoGui, wxDialog)

	EVT_BUTTON(wxOk,EmoGui::OkButton)
	EVT_BUTTON(wxUP,EmoGui::OnUP)
	EVT_BUTTON(wxDOWN,EmoGui::OnDOWN)
	EVT_BUTTON(wxLEFT,EmoGui::OnLEFT)
	EVT_BUTTON(wxRIGHT,EmoGui::OnRIGHT)

END_EVENT_TABLE()

EmoGui::EmoGui(wxWindow* parent, int *Class, bool *demo):EmoGuiProc(parent)
{
	Classification = Class;
	Demo = demo;
}

EmoGui::~EmoGui(void)
{
}

void EmoGui::OkButton(wxCommandEvent& event)
{
	if (this->Up_Choice->IsEnabled()==true)
		Classification[2] = this->Up_Choice->GetCurrentSelection();
	else
		Classification[2] = NULL;
	if (this->Down_Choice->IsEnabled()==true)
		Classification[3] = this->Down_Choice->GetCurrentSelection();
	else
		Classification[3] = NULL;
	if (this->Left_Choice->IsEnabled()==true)
		Classification[0] = this->Left_Choice->GetCurrentSelection();
	else
		Classification[0] = NULL;
	if (this->Right_Choice->IsEnabled()==true)
		Classification[1] = this->Right_Choice->GetCurrentSelection();
	else
		Classification[1] = NULL;

	*Demo = this->myCheckBox->GetValue();
	this->Close();

}

void EmoGui::OnUP(wxCommandEvent& event)
{
	if (this->Up_Choice->IsEnabled()==true)
		this->Up_Choice->Disable();
	else
		this->Up_Choice->Enable();
}
void EmoGui::OnDOWN(wxCommandEvent& event)
{
	if (this->Down_Choice->IsEnabled()==true)
		this->Down_Choice->Disable();
	else
		this->Down_Choice->Enable();
}
void EmoGui::OnLEFT(wxCommandEvent& event)
{
	if (this->Left_Choice->IsEnabled()==true)
		this->Left_Choice->Disable();
	else
		this->Left_Choice->Enable();
}
void EmoGui::OnRIGHT(wxCommandEvent& event)
{
	if (this->Right_Choice->IsEnabled()==true)
		this->Right_Choice->Disable();
	else
		this->Right_Choice->Enable();
}


